Skip to content

Conversation

@Vaibhav-fusion
Copy link

Related issue: Docs: Links in navigation sidebar do not work for some sections #32302

I’m looking at the Three.js documentation here:
In the navigation sidebar, some sections — I specifically noticed TSL and Global — contain links that point to anchors which do not exist. This makes the navigation sidebar unusable in these sections.

For example, the first entry under the TSL section is rendered as:

<li>
  <a href="pages/TSL.html#Break" target="viewer" class="selected">Break</a>
</li>

However, when clicking this link in Safari, the browser rewrites the URL to:
https://threejs.org/docs/#TSL.Break

This is problematic because the actual method heading has the following markup:

<h3 class="name name-method" id="Break" translate="no">
  .<a href="#Break">Break</a>
  <span class="signature">()</span>
  <span class="type-signature"> : <a href="ExpressionNode.html">ExpressionNode</a></span>
</h3>

The element has id="Break", not id="TSL.Break", so Safari cannot jump to the correct section. As a result, all links in the TSL (and some other sections) fail to navigate properly.

Resolved this by fixing hasing in script tag

This issue appears only in Safari — Chromium-based browsers do not rewrite the hash.

if (el) el.scrollIntoView();
}
})();
</script>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems #32312 tries to solve this without changing the id tags.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah just took the part from the hash , so safari don't cause any problem with scorlling to the links .
I even like your idea too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants